<?php
require __DIR__ . '/../bootstrap.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$em = require __DIR__ . '/../example/em.php';

$manager = new \Service\SimManager($em);
$sims = $manager->getAll();
$html='<td>
            <div class = "btn-group">                
                <a href = "javascript:void(0)" class = "btn btn-mini" title = "Активность"><i class="splashy-okay"></i></a>
                <a href = "javascript:void(0)" class = "btn btn-mini remove_sim" title = "Удалить"><i class = "icon-trash"></i></a>
            </div>
        </td>';
$aaData = array();
$i = 1;
foreach ($sims as $sim) {
    $aaData['aaData'][] = array(
        (string) $i++,
        (string) $sim->getId(),
        $sim->getNumber(),
        $sim->getPuk(),
        $html
    );
}
//var_dump($aaData);
echo json_encode($aaData);
?>